<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function add(a,b)
			{
				return a+b;
				
			}
			document.write(add(3,5));
			var x = 10;
			var y = 20;
			var z = add(x,y);
			document.write(z);
			document.write(add(3*5,60-20));
			
			
			
			
			function add2(a = 10, b = 20)
			{
				return a+b;
				
			}
			document.write(add2(100,200))
			document.write(add2())
			
			
			function addA11()
			{
				for (i=0;i<arguments.length;i++) {
					console.log(arguments[i]);
				}
				addA11();
				addA11(10,20,30);
				
			}
			
			//返回值
			function add3(a,b)
			{
				var reuslt =a+b;
				console.log(result);
				return reuslt;
			}
			//直接打印
			console.log(add3(100,300));
			//用变量接收
			var result = add3(1000,3000);
			//或表达式
			var result2 = add3(1,2)+add3(3,4);
			console.log(result2);
		</script>
	</body>
</html>
